<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>

<!DOCTYPE HTML>
<html>
  <head> 
	<%@ include file="/platform/style.jsp"%>
	<link rel='stylesheet' type='text/css' href='${ctx}/plugins/jquery-gridly/jquery.gridly.css'>
	<script type="text/javascript" src="${ctx}/plugins/jquery-gridly/jquery.gridly.js"></script>
	<script type="text/javascript" src="${ctx}/plugins/plupload2/plupload.full.min.js"></script>
	  <script type="text/javascript" src="${ctx}/plugins/oss/upload.js"></script>
	<link rel="stylesheet" href="${ctx}/plugins/kindeditor/themes/default/default.css" />
	<script charset="utf-8" src="${ctx}/plugins/kindeditor/kindeditor.js"></script>
	<script charset="utf-8" src="${ctx}/plugins/kindeditor/lang/zh_CN.js"></script>
	<script>
     function query(){
        $w.execForm({pageNum:1});
     }
	function editstock(id){
		window.parent.$w.openDialog({url:ctx+'/products/ProductPage@inStock_Show.page?bean.id='+id,title:"修改商品库存 ",w:600,h:380,afterClose:function(re){
			if(re)query();
		}});
	}
	function showProduct(id){
		$w.openDialog({url:ctx+'/products/ProductPage@show.page?bean.edit=false&bean.id='+id,title:"查看商品",w:700,h:450,maximized:true,afterClose:function(re){
			
		}});
	}
    var keditor;
    var detail_editor,book_editor,aboutus_editor;
    KindEditor.ready(function(K) {
        keditor=K;
    })
	</script>
  </head>
  
  <body class="easyui-layout">
	<div data-options="region:'center'" class="bodybg">
		<!-- 查询区域 -->
		<form id="queryForm" action="/products/ProductPage@inStockList.page" method="post">
		<div class="easyui-panel ui-queryBar" border="false" data-options="doSize:false">
			<w:hidden bind="pageNum"/>
			<w:hidden bind="pageSize_"/>
			<table cellpadding="0" cellspacing="0" style="margin-top:5px">
				<tr>
					<td width="80" align="right">商品编号：</td><td><w:text bind="bean.code" style="width:140px;"/></td>
					<td width="80" align="right">商品名称：</td><td><w:text bind="bean.name" style="width:150px;"/></td>
					<td>
						&nbsp;<a href="javascript:;" class="easyui-linkbutton" iconCls="icon_search" onclick="query()">查询</a>
					</td>
				</tr>
			</table>
		</div>
		
		<div class="ui_line" style="margin-top:10px"></div>
		<!-- 数据列表区域 -->
			<table class="ui-table" width="100%" cellpadding="1" cellspacing="1" data-options="showPage:true,
																										pageNum:<w:write bind="pageNum"/>,
																										pageSize:<w:write bind="pageSize_"/>,
																										total:<w:write bind="pagination.totalCount"/>,form:'queryForm'">
				<thead>
					<tr class="ui_th">
						<td width="40">ID</td>
						<td width="60">商品图片</td>
						<td width="100">商品编号</td>
						<td>商品名称</td>
						<td width="100">总库存</td>
						<td width="100">冻结库存</td>
						<td width="100">可用库存</td>
						<td width="80" align="center">修改</td>
					</tr>
				</thead>
				<tbody>
				<w:iterate id="info" bind="resultList_">
					<tr class="ui_td">
						<td><w:write bind="#info.attrid"/></td>
						<td><a href="javascript:showProduct(<w:write bind="#info.id"/>);"><w:notEqual bind="#info.photoview" value=""><img src="${fileserver }<w:write bind="#info.photoview"/>" style="width:40px;height:30px;"></w:notEqual></a></td>
						<td><a href="javascript:showProduct(<w:write bind="#info.id"/>);" class="ui_a"><w:write bind="#info.code"/></a></td>
						<td><a href="javascript:showProduct(<w:write bind="#info.id"/>);" class="ui_a"><w:write bind="#info.name"/> <w:write bind="#info.attrname"/></a></td>
						<td><w:write bind="#info.totalamount"/></td>
						<td><w:write bind="#info.djamount"/></td>
						<td><w:write bind="#info.amount"/></td>
						<td align="center">
							<a href="javascript:void(0);" class="ui_btn marginR8" onclick="editstock(<w:write bind="#info.attrid"/>)">修改</a>
						</td>
					</tr>
				</w:iterate>
				</tbody>
			</table>
		</form>
		
	</div>
	
  </body>
</html>
